<template>
  <div>
    <div class="recommend-title">热销推荐</div>
    <ul>
      <router-link tag="li" class="item" v-for="item of recommendList" :key="item.id" :to="'/detail/' + item.id">
        <img class="item-img" :src="item.imgUrl"/>
        <div class="item-info">
          <p class="item-title">{{ item.title }}</p>
          <p class="item-desc">{{ item.desc }}</p>
          <button class="item-button">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>
<script>
export default {
  name: 'HomeRecommend',
  props: {
    recommendList: Array
  }
}
</script>
<style lang="stylus" scoped>
  .recommend-title
    line-height: .8rem
    height: .8rem
    background: #eee
    text-indent: .2rem
  .item
      height: 2 rem
      position: relative
      .item-img
        width: 1.7rem
        height: 1.7 rem
        float: left
        margin-left: .2 rem
        margin-top: .15 rem
      .item-title
        line-height: .54 rem
        position: absolute
        top: .2 rem
        left: 2.1 rem
        margin-bottom: .2 rem
      .item-desc
        line-height: .4 rem
        font-size: .2rem
        color: #ccc
        position: absolute
        top: .8 rem
        left: 2.1 rem
        margin-bottom: .2 rem
      .item-button
        position: absolute
        top: 1.4 rem
        left: 2.1 rem
</style>
